#include <iostream>
using namespace std;

int n;

bool check(int x)
{
  int pos = 1;
  while(x)
  {
    int a = x % 10;
    if(pos % 2 == 1 && a % 2 != 1) return false;
    if(pos % 2 == 0 && a % 2 != 0) return false;
    pos++;
    x /= 10;
  }
  return true;
}

int main()
{
  cin >> n;
  long long cnt = 0;
  for(int i = 1; i <= n; i++)
  {
    if(check(i)) cnt++;
  }
  cout << cnt << endl;

  return 0;
}
